import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/prod/spec/page',
    method: 'get',
    params,
    headers: {
      "authorization": localStorage.getItem("token")
    }
  })
}
export function add(data) {
  return request({
    url: '/prod/spec',
    method: 'POST',
    data: {
      t: Date.now(),
      ...data
    },
    headers: {
      "authorization": localStorage.getItem("token")
    }
  })
}
export function update(data) {
  return request({
    url: '/prod/spec',
    method: 'get',
    data: {
      t: Date.now(),
      ...data
    },
    headers: {
      "authorization": localStorage.getItem("token")
    }
  })
}
export function del(a) {
  return request({
    url: '/prod/spec/' + a,
    method: 'DELETE',
    data: {},
    headers: {
      "authorization": localStorage.getItem("token")
    }
  })
}
export function search(params) {
  return request({
    url: '/prod/spec/page',
    method: 'GET',
    params: {
      ...params,
      t: Date.now()
    },
    headers: {
      "authorization": localStorage.getItem("token")
    }
  })
}